package com.lxy.aimin.auth.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ProxyHandler implements InvocationHandler {


    private Object target;

    public ProxyHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("动态代理开始拦截。。。");
        Object invoke = method.invoke(target, args);
        System.out.println("动态代理拦截结束。。。");
        return invoke;
    }
}
